package com.woniuxy.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.order.entity.OrderApplication;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 订单申请Mapper接口
 */
@Mapper
public interface OrderApplicationMapper extends BaseMapper<OrderApplication> {
    
    /**
     * 根据客户名称模糊查询订单
     */
    List<OrderApplication> selectByCustomerName(String customerName);
    
    /**
     * 根据审批状态查询订单
     */
    List<OrderApplication> selectByApplicationStatus(String applicationStatus);
    
    /**
     * 查询用户的待审批订单
     */
    List<OrderApplication> selectPendingOrdersByApprover(String approverName);
    
    /**
     * 统计各状态订单数量
     */
    Long countByStatus(String status);
    
    /**
     * 查询最近创建的订单
     */
    List<OrderApplication> selectRecentOrders(Integer limit);
}
